home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / LOCKD / XDR.H < prev   
C/C++ Source or Header  |  1999-09-17  |  2KB  |  98 lines

  1. /*
  2.  * linux/include/linux/lockd/xdr.h
  3.  *
  4.  * XDR types for the NLM protocol
  5.  *
  6.  * Copyright (C) 1996 Olaf Kirch <okir@monad.swb.de>
  7.  */
  8.  
  9. #ifndef LOCKD_XDR_H
  10. #define LOCKD_XDR_H
  11.  
  12. #include <linux/fs.h>
  13. #include <linux/nfs.h>
  14. #include <linux/sunrpc/xdr.h>
  15.  
  16. extern u32    nlm_granted, nlm_lck_denied, nlm_lck_denied_nolocks,
  17.         nlm_lck_blocked, nlm_lck_denied_grace_period;
  18.  
  19. /* Lock info passed via NLM */
  20. struct nlm_lock {
  21.     char *            caller;
  22.     struct nfs_fh        fh;
  23.     struct xdr_netobj    oh;
  24.     struct file_lock    fl;
  25. };
  26.  
  27. /*
  28.  *    NLM cookies. Technically they can be 1K, Nobody uses over 8 bytes
  29.  *    however.
  30.  */
  31.  
  32. struct nlm_cookie
  33. {
  34.     unsigned char data[8];
  35.     unsigned int len;
  36. };
  37.  
  38. /*
  39.  * Generic lockd arguments for all but sm_notify
  40.  */
  41. struct nlm_args {
  42.     struct nlm_cookie    cookie;
  43.     struct nlm_lock        lock;
  44.     u32            block;
  45.     u32            reclaim;
  46.     u32            state;
  47.     u32            monitor;
  48.     u32            fsm_access;
  49.     u32            fsm_mode;
  50. };
  51.  
  52. /*
  53.  * Generic lockd result
  54.  */
  55. struct nlm_res {
  56.     struct nlm_cookie    cookie;
  57.     u32            status;
  58.     struct nlm_lock        lock;
  59. };
  60.  
  61. /*
  62.  * statd callback when client has rebooted
  63.  */
  64. struct nlm_reboot {
  65.     char *        mon;
  66.     int        len;
  67.     u32        state;
  68.     u32        addr;
  69. };
  70.  
  71. /*
  72.  * Contents of statd callback when monitored host rebooted
  73.  */
  74. #define NLMSVC_XDRSIZE        sizeof(struct nlm_args)
  75.  
  76. void    nlmxdr_init(void);
  77. int    nlmsvc_decode_testargs(struct svc_rqst *, u32 *, struct nlm_args *);
  78. int    nlmsvc_encode_testres(struct svc_rqst *, u32 *, struct nlm_res *);
  79. int    nlmsvc_decode_lockargs(struct svc_rqst *, u32 *, struct nlm_args *);
  80. int    nlmsvc_decode_cancargs(struct svc_rqst *, u32 *, struct nlm_args *);
  81. int    nlmsvc_decode_unlockargs(struct svc_rqst *, u32 *, struct nlm_args *);
  82. int    nlmsvc_encode_res(struct svc_rqst *, u32 *, struct nlm_res *);
  83. int    nlmsvc_decode_res(struct svc_rqst *, u32 *, struct nlm_res *);
  84. int    nlmsvc_encode_void(struct svc_rqst *, u32 *, void *);
  85. int    nlmsvc_decode_void(struct svc_rqst *, u32 *, void *);
  86. int    nlmsvc_decode_shareargs(struct svc_rqst *, u32 *, struct nlm_args *);
  87. int    nlmsvc_encode_shareres(struct svc_rqst *, u32 *, struct nlm_res *);
  88. int    nlmsvc_decode_notify(struct svc_rqst *, u32 *, struct nlm_args *);
  89. int    nlmsvc_decode_reboot(struct svc_rqst *, u32 *, struct nlm_reboot *);
  90. /*
  91. int    nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *);
  92. int    nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
  93. int    nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *);
  94. int    nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
  95.  */
  96.  
  97. #endif /* LOCKD_XDR_H */
  98.